import { request } from '@ruifox-cms/utils'

//分页查询课程实例
export function selectPageInstance(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/instance/paging',
    method: 'post',
    data
  })
}
//根据Id查询课程实例
export function getByIdInstance(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/instance/getById',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded', // 设置请求头
    },
    data
  })
}
//根据课程Id查询课程实例
export function getCourseInstancesByCourseId(params) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/instance/getCourseInstancesByCourseId',
    method: 'get',
    params
  })
}
//创建课程实例
export function createInstance(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/instance/create',
    method: 'post',
    data
  })
}
//修改课程实例
export function updateInstance(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/instance/update',
    method: 'post',
    data
  })
}
//修改课程实例状态
export function changeStatusInstance(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/instance/changeStatus',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded', // 设置请求头
    },
    data
  })
}
//删除课程实例
export function deleteInstance(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/instance/delete',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded', // 设置请求头
    },
    data
  })
} 
//复制课程实例
 export function copyInstance(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/instance/copy',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded', // 设置请求头
    },
    data
  })
}
//用户中心分页查询课程实例
export function userCenterPagingInstance(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/instance/userCenterPaging',
    method: 'post',
    data
  })
}
//用户报名课程实例
export function addCourseUser(params) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/user/add',
    method: 'post',
    params,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded', // 设置请求头
    },
  })
}
//分页查询课程用户
export function pagingUser(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/user/paging',
    method: 'post',
    data
  })
}
//删除课程用户
export function deleteUser(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/user/delete',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded', // 设置请求头
    },
    data
  })
}
//添加课程用户
export function addUser(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/user/add',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded', // 设置请求头
    },
    data
  })
}
//获取用户课程信息
export function getUserCourseInfo(params) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/user/getUserCourseInfo',
    method: 'get',
    params
  })
}